package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum OrderStatus {
    //支付状态，0-未支付，1-已支付
    Unpaid("0","未支付"),
    Paid("1","已支付"),
    Fail("-1","支付失败");

    private String value;
    private String name;

    public static OrderStatus valuesOf(String value) {
        //获取所有枚举集合
        OrderStatus[] es = values();
        for (OrderStatus e : es) {
            if (Objects.equals(e.getValue(), value)) {
                return e;
            }
        }
        return null;
    }
}
